
@EnableScheduling
@SpringBootApplication
@MapperScan("...easyface.mapper")
@Slf4j
public class EasyFaceApplication {


    public static void main(String[] args) throws InterruptedException {
        ApplicationContext context = SpringApplication.run(EasyFaceApplication.class, args);
        DeviceStore deviceStore = context.getBean(DeviceStore.class);
        //开启人脸机应用
        if(NetSDKLib.NETSDK_INSTANCE != null && NetSDKLib.CONFIG_INSTANCE != null) {
            LoginModule.init(context.getBean(DisConnectListener.class), context.getBean(HaveReConnectListener.class));   // 打开工程，初始化
            System.out.println("休眠10秒后再开始设备登录和事件监听");  //保证资源加载完毕
            Thread.sleep(10000);
            deviceStore.startBatch(false);
        }
        //读取命令行指令
        new Thread(new DeviceCmdControl(deviceStore)).start();
        while(true){
            Thread.sleep(60000);
        }
    }

}
